javascript get string between two parentheses

51

javascript get string between two parentheses -

var regExp = /\(([^)]+)\)/;
var matches = regExp.exec("I expect five hundred dollars ($500).");

//matches[1] contains the value between the parentheses
console.log(matches[1]);

Comments

Submit
0 Comments